/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * <p>Project: javase - T4
 * <p>Powered by webrx On 2021-12-24 11:32:42
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T4 {
    public static void main(String[] args) throws ParseException {
        Timer t = new Timer();
        TimerTask tt = new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello world");
                //t.cancel();
            }
        };

        //t.schedule(tt, 3000);
        //t.schedule(tt, 5000, 1000);
        t.scheduleAtFixedRate(tt, 5000, 1000);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date time = sdf.parse("2021-12-24 11:42:00");
        //t.schedule(tt, time);
        //t.schedule(tt, time, 2000);
    }
}
